package com.jyl.gateway.kit;

import com.jyl.gateway.util.SpringBeanFactory;
import com.jyl.gateway.watcher.RouterWatcher;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;

@Slf4j
public class ServerListListener implements Runnable{

    private RouterWatcher routerWatcher;

    @Value("${netty.router}")
    private String zkNettyRouter;


    public ServerListListener() {
        this.routerWatcher = SpringBeanFactory.getBean(RouterWatcher.class);
    }

    @Override
    public void run() {
        try {
            routerWatcher.subscribeEvent();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
